package com.heima.wemedia.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.CommentRepaysDtos;
import com.heima.model.wemedia.dtos.CommetStatusDtos;
import com.heima.wemedia.service.WmCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/api/v1/comment/manage")
public class WmCommentContriller {

    @Autowired
    private WmCommentService wmCommentService;

    //打开或关闭评论
    @PostMapping("/update_comment_status")
    public ResponseResult updateCommentStatus(@RequestBody CommetStatusDtos dto) {
        return wmCommentService.updateCommentStatus(dto);
    }

    //文章评论详情
    @PostMapping("list")
    public ResponseResult details(@RequestBody CommentRepaysDtos dto) {
        return wmCommentService.details(dto);
    }
}
